<template>
  <div>
    <div class="middle">
      <ToolItem v-for="item in toolList" :key="item.id" :itemInfo="item" @click.native="toToolDetail(item)"></ToolItem>
    </div>
  </div>
</template>

<script>
import ToolItem from "../../components/common/ToolItem";

export default {
  name: "ToolManager",
  components: {
    // Header,
    ToolItem,
    // ForgetItem,
  },
  data() {
    return {
      // tabPosition:0,
      toolList:[],
      userInfo:{
        username:'',
      },
    };
  },
  created(){
    // let param = {
    //     account: this.account,
    //     password: this.password,
    //   };

      this.$api.admin.getToolsList('').then((res) => {
        // console.log(res);
        if(res.code==1){
            this.toolList = res.data.list;
                        console.log(res);
            this.userInfo.username = res.data.username;          

        }
        // this.data = res.data.data;
        // this.loading = false;
      });
  },
  methods: {
    toToolDetail(item){
      // window.location.href = item.url;
      window.open(item.url,"_blank");
    }
  },
};
</script>

<style lang="scss" scoped>

.middle {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-left: 30px;
  margin-right: 30px;
  
}


</style>